<?php $this->load->view("common/page_header");?>
<div id="body_main">
	<div id="admin_header">
		<?php $this->load->view('common/admin_header'); ?>
		<div class="top_cleft">
			<ul>
				<li class="current"><a href="/admin/story_scroller">滚动信息</a></li>
				<li><a href="/console/stories">事项删除</a></li>
			</ul>
			<div class="clear"></div>
		</div>
	</div>
	<div id="admin_content">
		<div id="admin_navigator">
			<ul class="navigator">
				<li class="current"><a href="/admin/story_scroller">首页滚动信息</a></li>
			</ul>
		</div>
		<div id="admin_body">
			<form method="post" action="">
				<label>事项编号：</label>
				<input type="text" class="input_text_short" name="id"/>
				<input type="hidden" name="action" value="set"></input>
				<input type="submit" class="input_button margin_left15" value="提交"/>
			</form>
			<div class="margin_top15 margin_bottom5" style="margin-top:50px">
				<span class="bold margin_right15">已发布的滚动信息</span>
				<input type="button" value="删除" id="remove-button" class="blue_button" style="float:none;border:0"/>
			</div>
			<form method="post" id="post-form">
			<table class="b_table">
				<tr>
					<th width="70"><input type="checkbox" id="check-all" />全选</th>
					<th width="150">事项编号</th>
					<th width="150">发布人</th>
					<th width="200">提交时间</th>
					<th></th>
				</tr>
				<?php if (!empty($stories)) {?>
				<?php foreach($stories as $story) { ?>
				<tr>
					<td><input type="checkbox" name="ids[]" value="<?php echo $story['id'];?>"/></td>
					<td><?php echo $story['id']+1000000;?></td>
					<td><a href="/user/show?user_id=<?php echo $story['created_by']?>"><?php echo $story['nickname'];?></a></td>
					<td><?php echo substr($story['top_start_time'], 0 ,10)?></td>
					<td></td>
				</tr>
				<?php } ?>
				<?php }?>
			</table>
			<input type="hidden" name="action" value="unset"></input>
			</form>
		</div>
		<div class="clear"></div>
	</div>
	<?php $this->load->view("common/footer");?>	
</div>
<script type="text/javascript">
$(document).ready(function(){
	$("#check-all").click(function() {
		if ($("#check-all").attr("checked")) {
			$("input[name='ids[]']").attr("checked", true);
		} else {
			$("input[name='ids[]']").attr("checked", false);
		}
	});

	$("#remove-button").click(function() {
		$("#post-form").submit();
	});
});
</script>	
<?php $this->load->view("common/page_footer");?>